package com.hmall.common.client;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.OrderDetailDTO;
import com.hmall.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

/**
 * ClassName: itemClient
 * Package:
 * Description
 *
 * @Author xw
 * @Create 2023/12/22 16:56
 */
@FeignClient(value = "itemservice")

public interface ItemClient {
    @GetMapping("/item/list")
    PageDTO<Item> queryItemByPage(
            @RequestParam("page") Integer page,
            @RequestParam("size") Integer size);


    @GetMapping("/item/{id}")
        //声明请求方式   声明请求路径
    Item queryItemById(@PathVariable("id") Long id); //返回值类型 声明请求参数


    @PutMapping("/item/stock/{itemId}/{num}")
    void deductStock(@PathVariable("itemId") Long itemId,
                     @PathVariable("num") Long num

    );


}
